package com.CampusLife.service.impl;
import  com.CampusLife.bean.Favorite;
import  com.CampusLife.dao.IFavoriteDao;
import com.CampusLife.dto.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import  com.CampusLife.service.IFavoriteService;
import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class FavoriteServiceImpl implements IFavoriteService {
    @Resource
    private IFavoriteDao iFavoriteDao;

    @Override
    public List<Favorite> queryAll() {
        return iFavoriteDao.queryAll();
    }

    @Override
    public List<Favorite> queryById(Integer id) {
        return iFavoriteDao.queryById(id);
    }

    @Override
    public void add(Favorite favorite) {
        iFavoriteDao.add(favorite);
    }

    @Override
    public void update(Favorite favorite) {

        iFavoriteDao.update(favorite);
    }

    @Override
    public void delete(Integer fid) {
        iFavoriteDao.delete(fid);
    }

    @Override
    public List<Favorite> getFavoriteAll( Integer p_id) {

        List<Favorite> favorite = iFavoriteDao.getFavoriteAll(p_id);

        return favorite;
    }

    @Override
    public Integer queryByPid(Favorite favorite) {

        return iFavoriteDao.queryByPid(favorite);
    }

    @Override
    public int queryCount(int id) {
        return iFavoriteDao.queryCount(id);
    }
}
